/*
 Navicat Premium Data Transfer

 Source Server         : nest-template-cms
 Source Server Type    : MySQL
 Source Server Version : 80300 (8.3.0)
 Source Host           : 0.0.0.0:3307
 Source Schema         : soybean-test

 Target Server Type    : MySQL
 Target Server Version : 80300 (8.3.0)
 File Encoding         : 65001

 Date: 06/09/2024 18:31:55
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for t_sys_menu
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_menu`;
CREATE TABLE `t_sys_menu` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `create_id` bigint DEFAULT NULL COMMENT '创建人id',
  `create_by` varchar(12) DEFAULT NULL COMMENT '创建人',
  `create_time` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) COMMENT '创建时间',
  `update_id` bigint DEFAULT NULL COMMENT '修改人id',
  `update_by` varchar(12) DEFAULT NULL COMMENT '修改人',
  `update_time` datetime(6) DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6) COMMENT '修改时间',
  `is_deleted` tinyint NOT NULL DEFAULT '0' COMMENT '是否删除',
  `delete_time` datetime(6) DEFAULT NULL COMMENT '删除时间',
  `parent_id` bigint DEFAULT NULL,
  `menu_type` varchar(1) NOT NULL COMMENT '菜单类型1：目录；2：菜单',
  `status` varchar(1) NOT NULL COMMENT '状态；1:可用，2:禁用',
  `menu_name` varchar(255) NOT NULL COMMENT '菜单名称',
  `route_name` varchar(255) NOT NULL COMMENT '路由名称',
  `route_path` varchar(255) DEFAULT NULL COMMENT '菜单路由',
  `component` varchar(40) DEFAULT NULL COMMENT '菜单组件',
  `icon` varchar(40) DEFAULT NULL COMMENT '菜单图标',
  `icon_type` varchar(1) DEFAULT NULL COMMENT '图标类型 1: iconify图标 2 本地图标',
  `order` int DEFAULT NULL COMMENT '排序',
  `i18n_key` varchar(255) DEFAULT NULL COMMENT 'i18n字符',
  `href` varchar(255) DEFAULT NULL COMMENT '是否外链',
  `keep_alive` tinyint NOT NULL DEFAULT '0' COMMENT '是否缓存',
  `constant` tinyint NOT NULL DEFAULT '0' COMMENT '是否常量路由',
  `hide_in_menu` tinyint NOT NULL DEFAULT '0' COMMENT '是否隐藏菜单',
  `multi_tab` tinyint NOT NULL DEFAULT '0' COMMENT '是否支持多页签',
  `fixed_index_in_tab` int DEFAULT NULL COMMENT '固定在页签中的序号',
  `query` text COMMENT '路由参数',
  `active_menu` varchar(255) DEFAULT NULL COMMENT '高亮菜单',
  PRIMARY KEY (`id`),
  KEY `FK_1e66e5ffbb26a6d3976cb70cfa7` (`parent_id`),
  CONSTRAINT `FK_1e66e5ffbb26a6d3976cb70cfa7` FOREIGN KEY (`parent_id`) REFERENCES `t_sys_menu` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of t_sys_menu
-- ----------------------------
BEGIN;
INSERT INTO `t_sys_menu` (`id`, `create_id`, `create_by`, `create_time`, `update_id`, `update_by`, `update_time`, `is_deleted`, `delete_time`, `parent_id`, `menu_type`, `status`, `menu_name`, `route_name`, `route_path`, `component`, `icon`, `icon_type`, `order`, `i18n_key`, `href`, `keep_alive`, `constant`, `hide_in_menu`, `multi_tab`, `fixed_index_in_tab`, `query`, `active_menu`) VALUES (1, NULL, NULL, '2024-07-11 10:10:05.972958', NULL, NULL, '2024-07-12 06:55:14.000000', 0, NULL, NULL, '2', '1', 'login', 'login', '/login/:module(pwd-login|code-login|register|reset-pwd|bind-wechat)?', 'layout.blank$view.login', '', '1', 99, 'route.login', NULL, 0, 1, 1, 0, NULL, '[]', NULL);
INSERT INTO `t_sys_menu` (`id`, `create_id`, `create_by`, `create_time`, `update_id`, `update_by`, `update_time`, `is_deleted`, `delete_time`, `parent_id`, `menu_type`, `status`, `menu_name`, `route_name`, `route_path`, `component`, `icon`, `icon_type`, `order`, `i18n_key`, `href`, `keep_alive`, `constant`, `hide_in_menu`, `multi_tab`, `fixed_index_in_tab`, `query`, `active_menu`) VALUES (2, NULL, NULL, '2024-07-11 10:10:30.753875', NULL, NULL, '2024-07-12 06:55:36.000000', 0, NULL, NULL, '2', '1', '403', '403', '/403', 'layout.blank$view.403', '', '1', 99, 'route.403', NULL, 0, 1, 1, 0, NULL, '[]', NULL);
INSERT INTO `t_sys_menu` (`id`, `create_id`, `create_by`, `create_time`, `update_id`, `update_by`, `update_time`, `is_deleted`, `delete_time`, `parent_id`, `menu_type`, `status`, `menu_name`, `route_name`, `route_path`, `component`, `icon`, `icon_type`, `order`, `i18n_key`, `href`, `keep_alive`, `constant`, `hide_in_menu`, `multi_tab`, `fixed_index_in_tab`, `query`, `active_menu`) VALUES (3, NULL, NULL, '2024-07-11 10:10:46.997175', NULL, NULL, '2024-07-12 06:55:29.000000', 0, NULL, NULL, '2', '1', '404', '404', '/404', 'layout.blank$view.404', '', '1', 99, 'route.404', NULL, 0, 1, 1, 0, NULL, '[]', NULL);
INSERT INTO `t_sys_menu` (`id`, `create_id`, `create_by`, `create_time`, `update_id`, `update_by`, `update_time`, `is_deleted`, `delete_time`, `parent_id`, `menu_type`, `status`, `menu_name`, `route_name`, `route_path`, `component`, `icon`, `icon_type`, `order`, `i18n_key`, `href`, `keep_alive`, `constant`, `hide_in_menu`, `multi_tab`, `fixed_index_in_tab`, `query`, `active_menu`) VALUES (4, NULL, NULL, '2024-07-11 10:11:32.140261', NULL, NULL, '2024-07-12 06:55:21.000000', 0, NULL, NULL, '2', '1', '500', '500', '/500', 'layout.blank$view.500', '', '1', 99, 'route.500', NULL, 0, 1, 1, 0, NULL, '[]', NULL);
INSERT INTO `t_sys_menu` (`id`, `create_id`, `create_by`, `create_time`, `update_id`, `update_by`, `update_time`, `is_deleted`, `delete_time`, `parent_id`, `menu_type`, `status`, `menu_name`, `route_name`, `route_path`, `component`, `icon`, `icon_type`, `order`, `i18n_key`, `href`, `keep_alive`, `constant`, `hide_in_menu`, `multi_tab`, `fixed_index_in_tab`, `query`, `active_menu`) VALUES (5, NULL, NULL, '2024-07-12 06:56:52.838027', NULL, NULL, '2024-07-12 07:33:41.000000', 0, NULL, NULL, '2', '1', 'home', 'home', '/home', 'layout.base$view.home', 'mdi:monitor-dashboard', '1', 0, 'route.home', NULL, 0, 0, 0, 0, NULL, '[]', NULL);
INSERT INTO `t_sys_menu` (`id`, `create_id`, `create_by`, `create_time`, `update_id`, `update_by`, `update_time`, `is_deleted`, `delete_time`, `parent_id`, `menu_type`, `status`, `menu_name`, `route_name`, `route_path`, `component`, `icon`, `icon_type`, `order`, `i18n_key`, `href`, `keep_alive`, `constant`, `hide_in_menu`, `multi_tab`, `fixed_index_in_tab`, `query`, `active_menu`) VALUES (6, NULL, NULL, '2024-07-12 07:35:56.828010', NULL, NULL, '2024-07-12 07:35:56.828010', 0, NULL, NULL, '1', '1', 'manage', 'manage', '/manage', 'layout.base', 'carbon:cloud-service-management', '1', 9, 'route.manage', NULL, 0, 0, 0, 0, NULL, '[]', NULL);
INSERT INTO `t_sys_menu` (`id`, `create_id`, `create_by`, `create_time`, `update_id`, `update_by`, `update_time`, `is_deleted`, `delete_time`, `parent_id`, `menu_type`, `status`, `menu_name`, `route_name`, `route_path`, `component`, `icon`, `icon_type`, `order`, `i18n_key`, `href`, `keep_alive`, `constant`, `hide_in_menu`, `multi_tab`, `fixed_index_in_tab`, `query`, `active_menu`) VALUES (7, NULL, NULL, '2024-07-12 07:37:03.073325', NULL, NULL, '2024-09-04 09:45:59.000000', 0, NULL, 6, '2', '1', 'manage_menu', 'manage_menu', '/manage/menu', 'view.manage_menu', 'material-symbols:route', '1', 3, 'route.manage_menu', NULL, 1, 0, 0, 0, NULL, '[{\"key\":\"\",\"value\":\"\"}]', NULL);
INSERT INTO `t_sys_menu` (`id`, `create_id`, `create_by`, `create_time`, `update_id`, `update_by`, `update_time`, `is_deleted`, `delete_time`, `parent_id`, `menu_type`, `status`, `menu_name`, `route_name`, `route_path`, `component`, `icon`, `icon_type`, `order`, `i18n_key`, `href`, `keep_alive`, `constant`, `hide_in_menu`, `multi_tab`, `fixed_index_in_tab`, `query`, `active_menu`) VALUES (8, NULL, NULL, '2024-07-12 07:37:35.462897', NULL, NULL, '2024-07-12 07:37:35.462897', 0, NULL, 6, '2', '1', 'manage_role', 'manage_role', '/manage/role', 'view.manage_role', 'carbon:user-role', '1', 2, 'route.manage_role', NULL, 1, 0, 0, 0, NULL, '[]', NULL);
INSERT INTO `t_sys_menu` (`id`, `create_id`, `create_by`, `create_time`, `update_id`, `update_by`, `update_time`, `is_deleted`, `delete_time`, `parent_id`, `menu_type`, `status`, `menu_name`, `route_name`, `route_path`, `component`, `icon`, `icon_type`, `order`, `i18n_key`, `href`, `keep_alive`, `constant`, `hide_in_menu`, `multi_tab`, `fixed_index_in_tab`, `query`, `active_menu`) VALUES (9, NULL, NULL, '2024-07-12 07:38:04.903950', NULL, NULL, '2024-09-04 06:06:14.000000', 0, NULL, 6, '2', '1', 'manage_user', 'manage_user', '/manage/user', 'view.manage_user', 'ic:round-manage-accounts', '1', 1, 'route.manage_user', NULL, 1, 0, 0, 0, NULL, '[]', NULL);
COMMIT;

-- ----------------------------
-- Table structure for t_sys_menu_closure
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_menu_closure`;
CREATE TABLE `t_sys_menu_closure` (
  `id_ancestor` bigint NOT NULL,
  `id_descendant` bigint NOT NULL,
  PRIMARY KEY (`id_ancestor`,`id_descendant`),
  KEY `IDX_57e448ebeb335d3c232ac1431c` (`id_ancestor`),
  KEY `IDX_5df72dd6901862410fe5d54d16` (`id_descendant`),
  CONSTRAINT `FK_57e448ebeb335d3c232ac1431c3` FOREIGN KEY (`id_ancestor`) REFERENCES `t_sys_menu` (`id`) ON DELETE CASCADE,
  CONSTRAINT `FK_5df72dd6901862410fe5d54d166` FOREIGN KEY (`id_descendant`) REFERENCES `t_sys_menu` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of t_sys_menu_closure
-- ----------------------------
BEGIN;
INSERT INTO `t_sys_menu_closure` (`id_ancestor`, `id_descendant`) VALUES (1, 1);
INSERT INTO `t_sys_menu_closure` (`id_ancestor`, `id_descendant`) VALUES (2, 2);
INSERT INTO `t_sys_menu_closure` (`id_ancestor`, `id_descendant`) VALUES (3, 3);
INSERT INTO `t_sys_menu_closure` (`id_ancestor`, `id_descendant`) VALUES (4, 4);
INSERT INTO `t_sys_menu_closure` (`id_ancestor`, `id_descendant`) VALUES (5, 5);
INSERT INTO `t_sys_menu_closure` (`id_ancestor`, `id_descendant`) VALUES (6, 6);
INSERT INTO `t_sys_menu_closure` (`id_ancestor`, `id_descendant`) VALUES (6, 7);
INSERT INTO `t_sys_menu_closure` (`id_ancestor`, `id_descendant`) VALUES (6, 8);
INSERT INTO `t_sys_menu_closure` (`id_ancestor`, `id_descendant`) VALUES (6, 9);
INSERT INTO `t_sys_menu_closure` (`id_ancestor`, `id_descendant`) VALUES (7, 7);
INSERT INTO `t_sys_menu_closure` (`id_ancestor`, `id_descendant`) VALUES (8, 8);
INSERT INTO `t_sys_menu_closure` (`id_ancestor`, `id_descendant`) VALUES (9, 9);
COMMIT;

-- ----------------------------
-- Table structure for t_sys_menu_permission
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_menu_permission`;
CREATE TABLE `t_sys_menu_permission` (
  `menu_id` bigint NOT NULL,
  `permission_id` bigint NOT NULL,
  PRIMARY KEY (`menu_id`,`permission_id`),
  KEY `IDX_ed29dbe60a5315556291c36959` (`menu_id`),
  KEY `IDX_878e63311f78fcd2a82dd380be` (`permission_id`),
  CONSTRAINT `FK_878e63311f78fcd2a82dd380be8` FOREIGN KEY (`permission_id`) REFERENCES `t_sys_permission` (`id`),
  CONSTRAINT `FK_ed29dbe60a5315556291c369597` FOREIGN KEY (`menu_id`) REFERENCES `t_sys_menu` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of t_sys_menu_permission
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for t_sys_permission
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_permission`;
CREATE TABLE `t_sys_permission` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `create_id` bigint DEFAULT NULL COMMENT '创建人id',
  `create_by` varchar(12) DEFAULT NULL COMMENT '创建人',
  `create_time` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) COMMENT '创建时间',
  `update_id` bigint DEFAULT NULL COMMENT '修改人id',
  `update_by` varchar(12) DEFAULT NULL COMMENT '修改人',
  `update_time` datetime(6) DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6) COMMENT '修改时间',
  `is_deleted` tinyint NOT NULL DEFAULT '0' COMMENT '是否删除',
  `delete_time` datetime(6) DEFAULT NULL COMMENT '删除时间',
  `permission_desc` varchar(50) NOT NULL COMMENT '权限描述',
  `permission_code` varchar(50) NOT NULL COMMENT '权限代码',
  `menuId` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `IDX_e2f8dfd44a632e6b0d8614ddf8` (`permission_code`),
  KEY `FK_49346fa5ab02c53b30300f3fdee` (`menuId`),
  CONSTRAINT `FK_49346fa5ab02c53b30300f3fdee` FOREIGN KEY (`menuId`) REFERENCES `t_sys_menu` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=39 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of t_sys_permission
-- ----------------------------
BEGIN;
INSERT INTO `t_sys_permission` (`id`, `create_id`, `create_by`, `create_time`, `update_id`, `update_by`, `update_time`, `is_deleted`, `delete_time`, `permission_desc`, `permission_code`, `menuId`) VALUES (23, 8, 'zhangsan', '2024-09-04 09:41:20.764000', 8, 'zhangsan', '2024-09-04 09:41:20.764000', 0, NULL, '编辑菜单', 'system:menu:edit', 7);
INSERT INTO `t_sys_permission` (`id`, `create_id`, `create_by`, `create_time`, `update_id`, `update_by`, `update_time`, `is_deleted`, `delete_time`, `permission_desc`, `permission_code`, `menuId`) VALUES (24, 8, 'zhangsan', '2024-09-04 09:42:00.307000', 8, 'zhangsan', '2024-09-04 09:42:00.307000', 0, NULL, '批量删除菜单', 'system:menu:batchDelete', 7);
INSERT INTO `t_sys_permission` (`id`, `create_id`, `create_by`, `create_time`, `update_id`, `update_by`, `update_time`, `is_deleted`, `delete_time`, `permission_desc`, `permission_code`, `menuId`) VALUES (25, 8, 'zhangsan', '2024-09-04 09:42:00.307000', 8, 'zhangsan', '2024-09-04 09:42:00.307000', 0, NULL, '删除菜单', 'system:menu:delete', 7);
INSERT INTO `t_sys_permission` (`id`, `create_id`, `create_by`, `create_time`, `update_id`, `update_by`, `update_time`, `is_deleted`, `delete_time`, `permission_desc`, `permission_code`, `menuId`) VALUES (34, 1, 'admin', '2024-09-05 10:20:26.865000', 8, 'zhangsan', '2024-09-05 10:20:26.865000', 0, NULL, '编辑用户', 'system:user:edit', 9);
INSERT INTO `t_sys_permission` (`id`, `create_id`, `create_by`, `create_time`, `update_id`, `update_by`, `update_time`, `is_deleted`, `delete_time`, `permission_desc`, `permission_code`, `menuId`) VALUES (35, 8, 'zhangsan', '2024-09-06 06:49:49.992379', NULL, NULL, '2024-09-06 06:49:49.992379', 0, NULL, '新增菜单', 'system:menu:add', 7);
INSERT INTO `t_sys_permission` (`id`, `create_id`, `create_by`, `create_time`, `update_id`, `update_by`, `update_time`, `is_deleted`, `delete_time`, `permission_desc`, `permission_code`, `menuId`) VALUES (36, 8, 'zhangsan', '2024-09-06 06:51:13.240612', NULL, NULL, '2024-09-06 06:51:13.240612', 0, NULL, '新增用户', 'system:user:add', 9);
INSERT INTO `t_sys_permission` (`id`, `create_id`, `create_by`, `create_time`, `update_id`, `update_by`, `update_time`, `is_deleted`, `delete_time`, `permission_desc`, `permission_code`, `menuId`) VALUES (37, 8, 'zhangsan', '2024-09-06 06:51:13.240612', NULL, NULL, '2024-09-06 06:51:13.240612', 0, NULL, '删除用户', 'system:user:delete', 9);
INSERT INTO `t_sys_permission` (`id`, `create_id`, `create_by`, `create_time`, `update_id`, `update_by`, `update_time`, `is_deleted`, `delete_time`, `permission_desc`, `permission_code`, `menuId`) VALUES (38, 8, 'zhangsan', '2024-09-06 06:51:13.240612', NULL, NULL, '2024-09-06 06:51:13.240612', 0, NULL, '批量删除用户', 'system:user:batchDelete', 9);
COMMIT;

-- ----------------------------
-- Table structure for t_sys_role
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_role`;
CREATE TABLE `t_sys_role` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `create_id` bigint DEFAULT NULL COMMENT '创建人id',
  `create_by` varchar(12) DEFAULT NULL COMMENT '创建人',
  `create_time` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) COMMENT '创建时间',
  `update_id` bigint DEFAULT NULL COMMENT '修改人id',
  `update_by` varchar(12) DEFAULT NULL COMMENT '修改人',
  `update_time` datetime(6) DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6) COMMENT '修改时间',
  `is_deleted` tinyint NOT NULL DEFAULT '0' COMMENT '是否删除',
  `delete_time` datetime(6) DEFAULT NULL COMMENT '删除时间',
  `role_name` varchar(16) NOT NULL COMMENT '角色名称',
  `role_code` varchar(64) NOT NULL COMMENT '角色code',
  `status` enum('1','2') NOT NULL DEFAULT '1' COMMENT '状态1、可用，2、禁用',
  `role_desc` varchar(255) DEFAULT NULL COMMENT '角色详情',
  `type` tinyint NOT NULL DEFAULT '1' COMMENT '角色类型1、公共角色，2、特殊角色',
  PRIMARY KEY (`id`),
  UNIQUE KEY `IDX_79d8fff11a9849a9c45785977e` (`role_code`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of t_sys_role
-- ----------------------------
BEGIN;
INSERT INTO `t_sys_role` (`id`, `create_id`, `create_by`, `create_time`, `update_id`, `update_by`, `update_time`, `is_deleted`, `delete_time`, `role_name`, `role_code`, `status`, `role_desc`, `type`) VALUES (1, NULL, NULL, '2024-07-11 09:44:46.000000', NULL, NULL, NULL, 0, NULL, '超级管理员', 'R_SUPER', '1', '权限超级大，拥有所有权限', 2);
INSERT INTO `t_sys_role` (`id`, `create_id`, `create_by`, `create_time`, `update_id`, `update_by`, `update_time`, `is_deleted`, `delete_time`, `role_name`, `role_code`, `status`, `role_desc`, `type`) VALUES (2, NULL, NULL, '2024-07-12 10:30:14.910445', NULL, NULL, '2024-07-12 10:30:14.910445', 0, NULL, '普通管理员', 'admin', '1', '普通管理员拥有大部分系统权限', 1);
COMMIT;

-- ----------------------------
-- Table structure for t_sys_role_menu
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_role_menu`;
CREATE TABLE `t_sys_role_menu` (
  `role_id` bigint NOT NULL,
  `menu_id` bigint NOT NULL,
  PRIMARY KEY (`role_id`,`menu_id`),
  KEY `IDX_243fb2ac9e7181c24983f96865` (`role_id`),
  KEY `IDX_cba9a5341665713f01f56011fd` (`menu_id`),
  CONSTRAINT `FK_243fb2ac9e7181c24983f968654` FOREIGN KEY (`role_id`) REFERENCES `t_sys_role` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `FK_cba9a5341665713f01f56011fde` FOREIGN KEY (`menu_id`) REFERENCES `t_sys_menu` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of t_sys_role_menu
-- ----------------------------
BEGIN;
INSERT INTO `t_sys_role_menu` (`role_id`, `menu_id`) VALUES (1, 5);
INSERT INTO `t_sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 5);
INSERT INTO `t_sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 6);
INSERT INTO `t_sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 7);
INSERT INTO `t_sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 8);
INSERT INTO `t_sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 9);
COMMIT;

-- ----------------------------
-- Table structure for t_sys_role_permission
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_role_permission`;
CREATE TABLE `t_sys_role_permission` (
  `role_id` bigint NOT NULL,
  `permission_id` bigint NOT NULL,
  PRIMARY KEY (`role_id`,`permission_id`),
  KEY `IDX_f36ffbe8f481867be1d67f554c` (`role_id`),
  KEY `IDX_61cb1bb417b108439be56b0519` (`permission_id`),
  CONSTRAINT `FK_61cb1bb417b108439be56b05197` FOREIGN KEY (`permission_id`) REFERENCES `t_sys_permission` (`id`),
  CONSTRAINT `FK_f36ffbe8f481867be1d67f554cb` FOREIGN KEY (`role_id`) REFERENCES `t_sys_role` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of t_sys_role_permission
-- ----------------------------
BEGIN;
INSERT INTO `t_sys_role_permission` (`role_id`, `permission_id`) VALUES (2, 23);
INSERT INTO `t_sys_role_permission` (`role_id`, `permission_id`) VALUES (2, 24);
INSERT INTO `t_sys_role_permission` (`role_id`, `permission_id`) VALUES (2, 25);
INSERT INTO `t_sys_role_permission` (`role_id`, `permission_id`) VALUES (2, 34);
INSERT INTO `t_sys_role_permission` (`role_id`, `permission_id`) VALUES (2, 35);
INSERT INTO `t_sys_role_permission` (`role_id`, `permission_id`) VALUES (2, 36);
INSERT INTO `t_sys_role_permission` (`role_id`, `permission_id`) VALUES (2, 37);
INSERT INTO `t_sys_role_permission` (`role_id`, `permission_id`) VALUES (2, 38);
COMMIT;

-- ----------------------------
-- Table structure for t_sys_user
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_user`;
CREATE TABLE `t_sys_user` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `create_id` bigint DEFAULT NULL COMMENT '创建人id',
  `create_by` varchar(12) DEFAULT NULL COMMENT '创建人',
  `create_time` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) COMMENT '创建时间',
  `update_id` bigint DEFAULT NULL COMMENT '修改人id',
  `update_by` varchar(12) DEFAULT NULL COMMENT '修改人',
  `update_time` datetime(6) DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6) COMMENT '修改时间',
  `is_deleted` tinyint NOT NULL DEFAULT '0' COMMENT '是否删除',
  `delete_time` datetime(6) DEFAULT NULL COMMENT '删除时间',
  `nick_name` varchar(30) DEFAULT NULL COMMENT '账户昵称',
  `user_name` varchar(30) NOT NULL COMMENT '用户名',
  `password` varchar(64) DEFAULT NULL COMMENT '账号密码',
  `status` enum('1','2') NOT NULL DEFAULT '1' COMMENT '状态：1、可用 2、禁用',
  `otp_secret` varchar(100) DEFAULT NULL,
  `user_gender` enum('1','2') DEFAULT NULL COMMENT '性别: 1,男性 2， 女性',
  `user_phone` varchar(20) DEFAULT NULL COMMENT '电话',
  `user_email` varchar(30) DEFAULT NULL COMMENT '电子邮箱',
  `last_login_time` datetime DEFAULT NULL COMMENT '最后登录时间',
  `last_login_ip` varchar(50) DEFAULT NULL COMMENT '登录ip',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of t_sys_user
-- ----------------------------
BEGIN;
INSERT INTO `t_sys_user` (`id`, `create_id`, `create_by`, `create_time`, `update_id`, `update_by`, `update_time`, `is_deleted`, `delete_time`, `nick_name`, `user_name`, `password`, `status`, `otp_secret`, `user_gender`, `user_phone`, `user_email`, `last_login_time`, `last_login_ip`) VALUES (1, NULL, '', '2024-07-11 09:49:29.000000', NULL, '', '2024-07-12 10:23:35.000000', 0, NULL, '超级管理员', 'admin', '$2a$10$hc02Y6SK38Zg7XJb/PayveD8p0M7oyWjV1/WPLYZkvVAErhAVwZTC', '1', '', '1', '13189770694', 'abc@qq.com', '2024-07-11 09:49:29', '192.168.31.51');
INSERT INTO `t_sys_user` (`id`, `create_id`, `create_by`, `create_time`, `update_id`, `update_by`, `update_time`, `is_deleted`, `delete_time`, `nick_name`, `user_name`, `password`, `status`, `otp_secret`, `user_gender`, `user_phone`, `user_email`, `last_login_time`, `last_login_ip`) VALUES (8, NULL, '', '2024-07-16 05:58:34.510293', NULL, '', '2024-07-16 05:58:34.510293', 0, NULL, '', 'zhangsan', '$2a$10$hc02Y6SK38Zg7XJb/PayveD8p0M7oyWjV1/WPLYZkvVAErhAVwZTC', '1', '', NULL, '', '', NULL, '');
INSERT INTO `t_sys_user` (`id`, `create_id`, `create_by`, `create_time`, `update_id`, `update_by`, `update_time`, `is_deleted`, `delete_time`, `nick_name`, `user_name`, `password`, `status`, `otp_secret`, `user_gender`, `user_phone`, `user_email`, `last_login_time`, `last_login_ip`) VALUES (11, NULL, '', '2024-07-17 03:01:01.341318', 8, 'zhangsan', '2024-09-06 06:07:54.000000', 0, NULL, '曹军', 'zouqiang', '$2a$10$zAKVWCBRxAYo/e8OI5dLPesVw38.rU1I1UTIywxeA.NRpE/mcVOLC', '1', '', '2', '18164584261', 'w.inocdt@qq.com', NULL, '');
INSERT INTO `t_sys_user` (`id`, `create_id`, `create_by`, `create_time`, `update_id`, `update_by`, `update_time`, `is_deleted`, `delete_time`, `nick_name`, `user_name`, `password`, `status`, `otp_secret`, `user_gender`, `user_phone`, `user_email`, `last_login_time`, `last_login_ip`) VALUES (13, NULL, '', '2024-09-04 09:29:05.183015', NULL, '', '2024-09-04 09:29:05.183015', 0, NULL, '', 'linrui', '$2a$10$juvfbal6qr6IHxh93Ms0AOmt7yQMrVHsRIwMZi7V/W4YOEhzRZ9qa', '1', '', NULL, '', '', NULL, '');
COMMIT;

-- ----------------------------
-- Table structure for t_sys_user_role
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_user_role`;
CREATE TABLE `t_sys_user_role` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `create_id` bigint DEFAULT NULL COMMENT '创建人id',
  `create_by` varchar(12) DEFAULT NULL COMMENT '创建人',
  `create_time` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) COMMENT '创建时间',
  `update_id` bigint DEFAULT NULL COMMENT '修改人id',
  `update_by` varchar(12) DEFAULT NULL COMMENT '修改人',
  `update_time` datetime(6) DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6) COMMENT '修改时间',
  `is_deleted` tinyint NOT NULL DEFAULT '0' COMMENT '是否删除',
  `delete_time` datetime(6) DEFAULT NULL COMMENT '删除时间',
  `user_id` bigint NOT NULL COMMENT '用户id',
  `role_id` bigint NOT NULL COMMENT '角色id',
  PRIMARY KEY (`id`),
  KEY `user_id` (`role_id`),
  KEY `role_id` (`user_id`),
  CONSTRAINT `role_id` FOREIGN KEY (`user_id`) REFERENCES `t_sys_user` (`id`) ON DELETE CASCADE,
  CONSTRAINT `user_id` FOREIGN KEY (`role_id`) REFERENCES `t_sys_role` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=36 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of t_sys_user_role
-- ----------------------------
BEGIN;
INSERT INTO `t_sys_user_role` (`id`, `create_id`, `create_by`, `create_time`, `update_id`, `update_by`, `update_time`, `is_deleted`, `delete_time`, `user_id`, `role_id`) VALUES (1, NULL, NULL, '2024-07-11 09:51:54.000000', NULL, NULL, NULL, 0, NULL, 1, 1);
INSERT INTO `t_sys_user_role` (`id`, `create_id`, `create_by`, `create_time`, `update_id`, `update_by`, `update_time`, `is_deleted`, `delete_time`, `user_id`, `role_id`) VALUES (35, NULL, NULL, '2024-09-04 09:22:04.000000', NULL, NULL, '2024-09-04 09:22:04.000000', 0, NULL, 8, 2);
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
